# SPDX-FileCopyrightText: Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause
# 
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Copyright (c) 2021 ETH Zurich, Nikita Rudin

from legged_gym import LEGGED_GYM_ROOT_DIR, LEGGED_GYM_ENVS_DIR
from .base.legged_robot import LeggedRobot
from .base.legged_robot_noisy import LeggedRobotNoisy
from .base.legged_robot_noisy_crawl import LeggedRobotNoisyCrawl

from .aliengo.aliengo_parkour_config import AliengoParkourCfg, AliengoParkourCfgPPO
from .aliengo.aliengo_parkour_virtual_config import AliengoParkourVIRCfg
from .aliengo.aliengo_parkour_crawl_config import AliengoParkourCRAWLCfg, AliengoParkourCrawlCfgPPO

import os

from legged_gym.utils.task_registry import task_registry

task_registry.register( "aliengo", LeggedRobot, AliengoParkourCfg(), AliengoParkourCfgPPO() )  # 基础运动环境
task_registry.register( "ag_vi", LeggedRobot, AliengoParkourVIRCfg(), AliengoParkourCfgPPO() )  # 增加了虚拟障碍设定的环境
task_registry.register( "ag_noi", LeggedRobotNoisy, AliengoParkourVIRCfg(), AliengoParkourCfgPPO() )  # 虚拟障碍加相机噪声的环境
task_registry.register( "ag_cra", LeggedRobotNoisyCrawl, AliengoParkourCRAWLCfg(), AliengoParkourCrawlCfgPPO() )  # 虚拟障碍加相机噪声的环境

from legged_gym.envs.nav_env.legged_nav_single_finetune import LeggedNavSingleFTRobot
from legged_gym.envs.nav_env.legged_nav_single_finetune_config import AliengoNavSingleFTCfg, AliengoNavSingleFTCfgPPO
task_registry.register( "ag_ft", LeggedNavSingleFTRobot, AliengoNavSingleFTCfg(), AliengoNavSingleFTCfgPPO() )  # discarded

from legged_gym.envs.nav_env.legged_nav_single_finetune_v2 import LeggedNavSingleFTV2Robot
from legged_gym.envs.nav_env.legged_nav_single_finetune_v2_config import AliengoNavSingleFTV2Cfg
task_registry.register( "ag_ft_v2", LeggedNavSingleFTV2Robot, AliengoNavSingleFTV2Cfg(), AliengoNavSingleFTCfgPPO() )  # 场景二微调

from legged_gym.envs.nav_env.legged_nav_single_finetune_v2_crawl import LeggedNavSingleFTV2Crawl
from legged_gym.envs.nav_env.legged_nav_single_finetune_v2_config import AliengoNavSingleFTV2CrawlCfg, AliengoNavSingleFTV2CrawlCfgPPO
task_registry.register( "ag_ft_v2_cra", LeggedNavSingleFTV2Crawl, AliengoNavSingleFTV2CrawlCfg(), AliengoNavSingleFTV2CrawlCfgPPO() )  # crawl场景二微调
